package com.aabte.springbootlearn.springbootprometheus;

import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang3.RandomUtils;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author Daniel
 */
@Slf4j
@RestController
public class HomeController {

    @RequestMapping("/endpointA")
    public void handlerA(){
        log.info("Start handlerA.");
        try {
            Thread.sleep(RandomUtils.nextLong(0, 100));
        } catch (InterruptedException e) {
            log.error("", e);
        }
        log.info("End handlerA.");
    }

    @RequestMapping("/endpointB")
    public void handlerB(){
        log.info("Start handlerB.");
        try {
            Thread.sleep(RandomUtils.nextLong(0, 100));
        } catch (InterruptedException e) {
            log.error("", e);
        }
        log.info("End handlerB.");
    }

}
